package com.zygvip.demand.service.impl;

import com.zygvip.demand.dao.ExpertDao;
import com.zygvip.demand.entity.Expert;
import com.zygvip.demand.service.ExpertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

/**
 * Demo class
 *
 * @author dup
 * @Description: dup
 * @date 23:16 2018/4/17
 */
@Service
public class ExpertServiceImpl implements ExpertService {

    @Autowired
    ExpertDao expertDao;

    @Override
    public Page<Expert> findExpertPage(Integer page, Integer size) {
        Pageable pageable = new PageRequest(page, size, Sort.Direction.ASC, "sort");
        return expertDao.findAll(pageable);
    }
}
